//
//  NSArray+OCMap.m
//  ChatMainDemo
//
//  Created by peiw on 16/1/21.
//  Copyright © 2016年 peiw. All rights reserved.
//

#import "NSArray+OCMap.h"

@implementation NSArray (OCMap)

- (NSArray *)oc_map:(id (^)(id element , BOOL *stop))map {
    NSMutableArray *arr = [NSMutableArray array];
    for (id item in self) {
        BOOL stop = NO;
        id ret = map(item , &stop);
        if (stop == NO) {
            [arr addObject:ret];
        }
    }
    return arr;
}

@end
